public class test529_2 {
    public static void main(String[] args) {
        int[] arr1 = {23,12,15,36,77,46,34,24,99,100,2000,521,394};
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i] + " ");
        }
        //冒泡排序
        System.out.println();
        for (int j = 0; j < arr1.length - 1; j++) {
            for (int i = 0; i < arr1.length - 1 - j; i++) {
                if (arr1[i] > arr1[i + 1]) {
                    int temp = arr1[i];
                    arr1[i] = arr1[i + 1];
                    arr1[i + 1] = temp;
                }
            }
        }
        //遍历
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i] + " ");
        }
    }
}
